#include <stdio.h>
#include <unistd.h>
#include <pthread.h>


void* thrd_start_child(void* v)
{
	sleep(20);
	printf("created child thread");
}

void* thrd_start_routine(void* v)
{
    sleep(10);
    printf("created thread\n");
	pthread_t childid;
	pthread_create(&childid, NULL, &thrd_start_child, NULL);
}

int main()
{
        pthread_t thrdid;
                
        pthread_create(&thrdid, NULL, &thrd_start_routine, NULL);
        
        sleep(5);
        printf("main thread\n");
        pthread_exit(NULL); //会等待子线程退出
        return  0;
}
